home *** CD-ROM | disk | FTP | other *** search
/ Suzy B Software 2 / Suzy B Software CD-ROM 2 (1994).iso / modems / mod_a2l / delphi / delphi.bas < prev   
Encoding:
BASIC Source File  |  1995-05-02  |  1.9 KB  |  84 lines

  1. 'Delphi logon script
  2. 'The first time you run it, prompts for username and password
  3. Loop:
  4. FAST ON
  5. acct$ = SET$("STORM","Delphi","Username")
  6. temp$ = SET$("STORM","Delphi","Password")
  7. pwd$ = ""
  8. 'A Basic oddity, FOR loop will always be executed once!
  9. 'So check length first
  10. 'Decrypt it
  11. IF LEN(temp$) > 0 THEN
  12.     FOR x = 1 TO LEN(temp$)
  13.         pwd$ = pwd$ + CHR$( ASC( MID$(temp$,x,1)) XOR 255)
  14.     NEXT x
  15. ENDIF
  16. '
  17. IF LEN(acct$) = 0 OR LEN(pwd$) = 0 THEN
  18.     GOSUB Setup
  19.     IF LEN(acct$) = 0 OR LEN(pwd$) = 0 THEN
  20.         GOTO Loop
  21.     ELSE PRINT "Delphi setup Complete"
  22.         PRINT "Thank you"
  23.         PRINT "========="
  24.         END
  25.      ENDIF
  26. ENDIF
  27. 'Now do actual logon using Tymnet
  28. FAST OFF
  29. TERM OFF
  30. TOPW 1
  31. '
  32. WAIT 2,"identifier"
  33. SEND "O";
  34. WAIT 5,"please log in:"
  35. IF WAIT(0) = 0 THEN
  36. Failure:
  37.     TOPW 3
  38.     PRINT "Logon Failed"; CHR$(7)
  39.     TERM ON
  40.     END
  41. ENDIF
  42. SEND "DELPHI"
  43. WAIT 5,"Username:"
  44. SEND acct$
  45. WAIT 5,"Password:"
  46. SEND pwd$
  47. DUPLEX FULL
  48. TERM ON
  49. END
  50. '
  51. 'Prompt user for Delphi account and password
  52. 'And store information in STORM.INI file, after confirming it.
  53. Setup:
  54. TOPW 3:CLS :PRINT "Welcome to Storm's Delphi Setup Script"
  55. PRINT "===========================================":PRINT
  56. IF LEN(acct$) > 0 THEN GetPassword
  57. RepeatAcct:
  58. PRINT
  59. PRINT "Please enter your username";
  60. INPUT acct$
  61. IF LEN(acct$) = 0 THEN RepeatAcct
  62. 'Since acct was absent, assume password was as well
  63. GetPassword:
  64. PRINT
  65. PRINT "Please enter your password";
  66. INPUT pwd$
  67. IF LEN(pwd$) = 0 THEN GetPassword
  68. temp$ = ""
  69. 'Simple hack to encrypt password into graphics/foreign characters
  70. FOR x = 1 TO LEN(pwd$)
  71.     temp$ = temp$ + CHR$( ASC( MID$(pwd$,x,1)) XOR 255)
  72. NEXT x
  73. PRINT "Your Username is ";acct$
  74. PRINT "Your Password is ";pwd$
  75. PRINT "Is that correct (Y/N)"
  76. INPUT confirm$
  77. confirm$ = UCASE$( LEFT$(confirm$,1))
  78. IF confirm$ <> "Y" THEN RepeatAcct
  79. SET "STORM","Delphi","Password",temp$
  80. SET "STORM","Delphi","Username",acct$
  81. RETURN
  82.  
  83.  
  84.